"use strict";
module.exports = function (sequelize, DataTypes) {
    var StationConfig = sequelize.define("StationConfig", {
        name: {
            type: DataTypes.STRING,
            field: 'Name'
        },
        prjId: {
            type: DataTypes.INTEGER,
            field: 'PrjId'
        },
        mileage: {
            type: DataTypes.DOUBLE,
            field: 'Mileage'
        },
        e: {
            type: DataTypes.DOUBLE,
            field: 'E'
        },
        n: {
            type: DataTypes.DOUBLE,
            field: 'N'
        },
        h: {
            type: DataTypes.DOUBLE,
            field: 'H'
        },
        id: {
            type: DataTypes.INTEGER,
            field: 'Id',
            autoIncrement: true,
            primaryKey: true
        }
    }, {
            freezeTableName: true,
            timestamps: false,
            classMethods: {
                associate: function (models) {
                    StationConfig.hasMany(models.TargetPrismConfig, {
                        foreignKey: "StationId"
                    });
                    StationConfig.hasMany(models.TargetPrismResult, {
                        foreignKey: "StationId"
                    });
                }
            }
        });

    return StationConfig;
}